package com.example.suntest.group.impl;

import com.example.suntest.service.OmsService;
import org.springframework.core.ResolvableType;
import org.springframework.stereotype.Service;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;

/**
 * @version 1.0
 * @Package: com.example.suntest.group.impl
 * @ClassName: OmsServiceImpl
 * @Author: sgq
 * @Date: 2024/9/4 11:23
 * @Description: TODD
 */
@Service
public class OmsServiceImpl implements OmsService {

    @Override
    public <T> void getSourceClass(List<?> list, Class<T> clazz) {
        ResolvableType resolvableType = ResolvableType.forInstance(list);
        ResolvableType generic = resolvableType.getGeneric(0);
        Class<?> sourceClass = generic.getRawClass();
    }
}
